package func

/**
 *
 * @author tzp
 * @since 2021/1/16
 */
object PartialFunc {

  def sum(x: Int, y: Int): Int = x + y

  def main(args: Array[String]): Unit = {
    args.foreach(arg => println(arg))
    args.foreach(println(_))
    args.foreach(println _)
    args.foreach(println)

    val psum = sum(1, _: Int)
    val psum1: Int => Int = sum(1, (_: Int))
    val psum2: Int => Int = (x) => {
      sum(1, x)
    }
    println(psum)
    println(psum1)
    println(psum2)
    println(psum(2))

  }
}
